# 虚基类测试
class Father():
    def __init__(self, x):
        self.x = x;

    def method(self):
        raise NotImplementedError('父类抽象方法method未实现')
        print('hello'+self.x)
    def setZ(self):
        self.z = 1

class Child(Father):
    def __init__(self, x, y):
        Father.__init__(self, x)
        self.y = y

    def method(self):
        print('hello '+self.x+str(self.y))

    def printZ(self):
        # 调用父类的方法给孩子设置属性z
        Father.setZ(self)
        print(self.z)

if __name__ == '__main__':
    c = Child('喵', 2)
    c.method()
    c.printZ()